<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
	<title>社医堂</title>
	<link rel="stylesheet" type="text/css" href="../../../css/api.css" />
	<link rel="stylesheet" type="text/css" href="../../../css/hui.css" />
	<link rel="stylesheet" type="text/css" href="../../../css/iconfont.css" />
</head>

<body>
	<style>
		table tr td {
			padding: 10px;
		}

		#num {
			width: 100px;
			border: solid 1px #ccc;
			text-align: center;
			font-size: 25px;
		}

		body {
			background-color: #fff;
		}
	</style>

	<div class="hui-wrap">


		<div style="padding:25px;border-radius:6px;">
			<table style="width:100%;">
                    <tr>
                            <td style="font-size:18px;">                  
                                    预约时间            
                            </td>
                            
                        </tr>
				<tr>
					<td>
	
<input type="datetime-local" class="hui-input hui-input-clear" id="date" value="" style="border:solid #ccc 1px;padding:8px;" />
			
					</td>
					
				</tr>
				<tr>
					<td style="font-size:18px;">                  
							病情描述            
					</td>
					
				</tr>
		<tr>
			<td>

<textarea class="hui-input hui-input-clear" id="memo" style="border:solid #ccc 1px;padding:8px;width:96%;height:90px;"></textarea>
	
			</td>
			
		</tr>
				
			</table>
		</div>



		<button onclick="tijiao()" type="button" class="hui-button hui-button-large hui-primary"
			style="margin-top:15px;margin-left:30px;width:80%;">提交预约</button>


	</div>


	<script src="../../../script/hui.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../../script/hui-tab.js" type="text/javascript"></script>
	<script src="../../../script/api.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../../script/stm.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		apiready = function () {
            width = (api.frameWidth-100);
			hui('#date').css({color:'#F00', fontSize:'20px',width:width+'px'})


		};

		function tijiao(){

			var date = hui("#date").val();
			var memo = hui("#memo").val();
			if(date==''){
				api.toast({ msg:'日期不能为空',location:'top' })
				return false;
			}

			api.ajax({
				url  : $api.getStorage('geturl')+'&c=ajaxmember&a=appointment',
				method: 'post',
				data: {
					values: { 
						userid : $api.getStorage('userid'),
						docid  : $api.getStorage('docid'),
						hospid : $api.getStorage('hospid'),
						date   : date,
						memo   : memo,
					}
				}
			},function(res, err){

				if (res) {			
					if (res.status==1) {						
						api.toast({ msg:'提交成功',location:'top' })
						setTimeout("todoclist()",1500)
					}else{
						api.toast({ msg:res.tip,location:'top' })
					}
				} else {
					alert( JSON.stringify( err ) );
				}
			}); 

			
		}

		function todoclist(){
			toDetails('../doctor/','list',0);
		}

		
	</script>

</body>

</html>